//
//  ViewController.m
//  27-Block播放按钮练习
//
//  Created by mafeng on 16/8/19.
//  Copyright © 2016年 mafeng. All rights reserved.
//

#import "ViewController.h"
#import "PlayView.h"
#import <AVFoundation/AVFoundation.h>

@interface ViewController ()
@property (weak, nonatomic) IBOutlet PlayView *playVIew;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
  [self.playVIew play:^(UIButton *play) {
       
       
   } pause:^(UIButton *pause) {
       
       
   } next:^(UIButton *next) {
       
       
   } last:^(UIButton *last) {
       
       
   }];
    
//    NSString *playString = @"http://static.tripbe.com/videofiles/20121214/9533522808.f4v.mp4";
//    NSURL *url = [NSURL URLWithString:playString];
//    self.playerItem = [[AVPlayerItem alloc] initWithURL:url];
//    self.player = [AVPlayer playerWithPlayerItem:_playerItem];
//    // 将视频添加到AVpleyer层
//    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
//    [self.view.layer addSublayer:playerLayer];
//    // 播放页面大小
//    playerLayer.frame = CGRectMake(0, 0, self.view.bounds.size.width, 350);
//    // 设置显示图层是视频的宽高, 并使视频内容适应大小
//    playerLayer.videoGravity = AVLayerVideoGravityResizeAspect;
//    // 播放
//    [self.player play];
//    // 在指定时间播放
//  
//    // 设置音量
//    _player.volume = 1.0f;
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
